package org.wat.wcy.isi.mmazur.bp.io.core;

import static wb.Db.*;
import static wb.Segs.*;
import static wb.Ents.initWb;
import wb.Han;

import org.wat.wcy.isi.mmazur.bp.io.model.IdDesc;



public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		initWb(75, 150, 2048);
		wb.Seg seg = makeSeg("d:\\mydata", 2048);
//		closeSeg(seg, true);
//		seg = openSeg("mydata", true);
		// "phone-index" which we will use for indexing by phone number.
		Han pi = createDb(seg, 'T', "phone-index");
		IdDesc idDesc = new IdDesc("323");
		bt_Put(pi, idDesc.toString(), "1");
		idDesc = new IdDesc("32355");
		bt_Put(pi, idDesc.toString(), "1");
//
//	        String val = bt_Get(pb, makeName(recordNumber, "LN"));
//		System.out.println("val is " + val);
//		val = bt_Get(pb, makeName(recordNumber, "ZIP"));
//		System.out.println("val is " + val);
//		val = bt_Get(lni, makeName("Doe", recordNumber));
//		System.out.println("val is " + val);
//		val = bt_Get(pi, makeName("5551212", recordNumber));
//		System.out.println("val is " + val);
//		//bt_Scan(pb, 0, "", "zz", lambda(k(v), print(k, v), true),  -1);
		closeSeg(seg, false);;
		seg = openSeg("D:\\mydata", true);
		pi = openDb(seg, "phone-index");
		String val = bt_Get(pi, "323");
		System.out.println(val);
		closeSeg(seg, false);
	}

}
